home *** CD-ROM | disk | FTP | other *** search
- property booleanList, bmapList, unchecked, level, newLevel, firstLevelButton, soundList
- global gVTLgameObject, gSimObject
-
- on birth me
- set booleanList to [1, 0, 0]
- set bmapList to [the number of cast "Rookie", the number of cast "Jr.Foreman", the number of cast "Foreman"]
- set unchecked to the number of cast "uncheckedBox"
- set firstLevelButton to 45
- set level to 1
- set newLevel to 1
- set soundList to ["RookieSound", "Jr.ForemanSound", "ForemanSound"]
- return me
- end
-
- on redrawLevelButtons me, option
- repeat with x = 1 to count(booleanList)
- if x = option then
- set the castNum of sprite (firstLevelButton + x - 1) to unchecked + 1
- setAt(booleanList, x, 1)
- next repeat
- end if
- set the castNum of sprite (firstLevelButton + x - 1) to unchecked
- setAt(booleanList, x, 0)
- end repeat
- updateStage()
- end
-
- on predrawLevelButtons me
- repeat with x = 1 to count(booleanList)
- set channel to firstLevelButton + x - 1
- set the locH of sprite channel to the locH of sprite channel + 1000
- set the castNum of sprite channel to unchecked + getAt(booleanList, x)
- puppetSprite(channel, 1)
- end repeat
- end
-
- on puppetLevelButtons me
- repeat with x = 1 to count(booleanList)
- set channel to firstLevelButton + x - 1
- puppetSprite(channel, 1)
- end repeat
- end
-
- on unPuppetLevelButtons me
- repeat with x = 1 to count(booleanList)
- puppetSprite(firstLevelButton + x - 1, 0)
- end repeat
- end
-
- on resetLevel me, newLevel
- set level to newLevel
- set booleanList to [0, 0, 0]
- setAt(booleanList, level, 1)
- end
-
- on goToNewLevel me
- set the finishedFlag of gSimObject to 1
- changeGridSize(me)
- set level to newLevel
- newVTLgame(gVTLgameObject)
- end
-
- on changeGridSize me
- if (newLevel = 1) and (level > 1) then
- set the gridSize of gSimObject to "Large"
- initSizeVariables(gSimObject)
- else
- if (newLevel > 1) and (level = 1) then
- set the gridSize of gSimObject to "Small"
- initSizeVariables(gSimObject)
- end if
- end if
- end
-
- on playLevelSound me, whichLevel
- set soundName to getAt(soundList, whichLevel)
- puppetSound(soundName)
- updateStage()
- repeat while soundBusy(1)
- end repeat
- puppetSound(0)
- end
-